package cn.com.api.mapper.base;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.*;

import cn.com.api.entity.ApiU_match;

//DAO
public interface U_matchMapperBase {

	// 根据id查看
	@Select("SELECT * FROM U_MATCH  WHERE MATCH_ID = #{match_id}")
	public ApiU_match findU_matchById(Integer match_id);

	// 查看数据集
	@Select("SELECT * FROM U_match")
	public List<ApiU_match> findU_matchs();

	// 根据条件查看数据集
	public List<Map<String, Object>> findU_matchsByMap(HashMap condition);

	// 添加
	@Insert("INSERT INTO U_MATCH (MATCH_NAME, JOIN_COUNT, ENT_ID, AMOUNT, MATCH_INTRODUCE, MATCH_RULES, THUMBNAIL, THUMBNAIL_H5, PSTART_TIME, PEND_TIME, VSTART_TIME, VEND_TIME, RESULT_TIME, COUNTER_FEE, BONUS_AMOUNT, STATUS, REJECT_REASON, IS_PAY, WIN_AMOUNT, GUESS_AMOUNT, IS_NEED_VEDIO, EXT1, EXT2, EXT3, EXT4, EXT5, AUDIT_BY, AUDIT_TIME,is_award) VALUES (#{match_name}, #{join_count}, #{ent_id}, #{amount}, #{match_introduce}, #{match_rules}, #{thumbnail}, #{thumbnail_h5}, #{pstart_time}, #{pend_time}, #{vstart_time}, #{vend_time}, #{result_time}, #{counter_fee}, #{bonus_amount}, #{status}, #{reject_reason}, #{is_pay}, #{win_amount}, #{guess_amount}, #{is_need_vedio}, #{ext1}, #{ext2}, #{ext3}, #{ext4}, #{ext5}, #{audit_by}, #{audit_time},#{is_award})")
	@Options(useGeneratedKeys = true, keyProperty = "match_id")
	public int insertU_match(ApiU_match u_match);

	// 修改
	@Update("UPDATE U_MATCH SET MATCH_NAME = #{match_name}, JOIN_COUNT = #{join_count}, ENT_ID = #{ent_id}, AMOUNT = #{amount}, MATCH_INTRODUCE = #{match_introduce}, MATCH_RULES = #{match_rules}, THUMBNAIL = #{thumbnail}, THUMBNAIL_H5 = #{thumbnail_h5}, PSTART_TIME = #{pstart_time}, PEND_TIME = #{pend_time}, VSTART_TIME = #{vstart_time}, VEND_TIME = #{vend_time}, RESULT_TIME = #{result_time}, COUNTER_FEE = #{counter_fee}, BONUS_AMOUNT = #{bonus_amount}, STATUS = #{status}, REJECT_REASON = #{reject_reason}, IS_PAY = #{is_pay}, WIN_AMOUNT = #{win_amount}, GUESS_AMOUNT = #{guess_amount}, IS_NEED_VEDIO = #{is_need_vedio}, EXT1 = #{ext1}, EXT2 = #{ext2}, EXT3 = #{ext3}, EXT4 = #{ext4}, EXT5 = #{ext5}, AUDIT_BY = #{audit_by}, AUDIT_TIME = #{audit_time},is_award = #{is_award} WHERE MATCH_ID = #{match_id}")
	public int updateU_match(ApiU_match u_match);

	// 删除
	@Delete("DELETE FROM U_MATCH  WHERE MATCH_ID = #{match_id}")
	public int deleteU_match(Integer match_id);

	// Foreign keys revelant

	// region Indexs revelant

}
